import {readdir} from "fs/promises";
import Span from "@/app/learn/Span";

// 学习页面, 挑选要学的科目
export default async function LearnPage() {
    const dir = await readdir('public/questions')

    return (
        <div className={'flex flex-col items-center gap-3'}>
            <header className={'font-bold text-xl mt-4'}>课程列表</header>
            <div className={'flex flex-row gap-4'}>
                {dir.map((d, i) => (
                    <Span key={i} course={d}>{d}</Span>
                ))}
            </div>
        </div>
    )
}